﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H


#include "AiWebsocket.h"

#include <QMainWindow>
#include <QPushButton>
#include "AiPtuStruct.h"
#include "complexsetform.h"
#include "about.h"
#include "aifaceform.h"
#include <QUdpSocket>
#include <QTimer>

QT_BEGIN_NAMESPACE
namespace Ui
{
    class MainWindow;
}
QT_END_NAMESPACE


class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget* parent = nullptr);
    ~MainWindow();

    void on_open_and_close_clicked();

private slots:
    void initForm();

    void initScanUdp();

    void initWebsocket();

    void onScanUdpReadyRead();

    void on_btn_min_clicked();

    void on_btn_max_clicked(bool checked);

    void closeEvent(QCloseEvent* event);

    void on_btn_close_clicked();

    void on_btn_refresh_clicked();

    void on_btn_about_clicked(bool checked);

    void on_tableWidget_cellChanged(int row, int column);

    void on_tableWidget_cellDoubleClicked(int row, int column);

    void on_btn_link_clicked(bool checked);

    void onConnectState(bool state);

    void onlinkwebsocket(QString str);

    void on_tableWidget_cellClicked(int row, int column);

    void onSendUdpParam(DevScan data);

    void on_lineEdit_search_textChanged(const QString& arg1);

    void on_btn_out_clicked();

    void on_btn_link_clicked();


signals:
    void netparam(NetworkParam );
    void lock();
    void siggetnetparam(NetParam);

private:
    Ui::MainWindow* ui;

    QPushButton* btn;
    QList<int> rows;
    ComplexSetForm* complexsetform;
    about* info_about;
    QPoint clickPos;
    AiWebsocket* m_aiWebsocket;
    QUdpSocket* m_scanUdp;
    QTimer* timer;
    AiFaceForm* faceform;

protected:
    void mousePressEvent(QMouseEvent* e);
    void mouseMoveEvent(QMouseEvent* e);

};
#endif // MAINWINDOW_H
